var app = sm("do_App");
var page = sm("do_Page");
var nf = sm("do_Notification");
var openHelper = require("helper/open");
var userUtil = require("helper/user");

var headLeft=ui("headLeft");
headLeft.on("touch",function(){
	openHelper.open("source://view/search/search2.ui");
});

var headRight = ui("headRight");
headRight.on("touch",function(){
	if(userUtil.loginToken()==="undefined"||userUtil.loginToken()===""){
		nf.toast("请先登录再操作");
		return;
	}
	app.fire("qq_fire_hide_msg_tip");//隐藏所有消息小红点
	openHelper.open("source://view/im/message/myMessage.ui");
});

//显示消息小红点
app.on("qq_fire_show_msg_tip", function(data, e) {
	ui("imgMessageTip").visible = true;
})
//隐藏消息小红点
app.on("qq_fire_hide_msg_tip", function(data, e) {
	ui("imgMessageTip").visible = false;
})